<#include "/layout/layout.ftl">
<#import "/layout/macro.ftl" as macro>
<#import "/layout/select.ftl" as my/>
<#assign css>
    <style>
    </style>
</#assign>
<#assign js>
    <script>
        function agree(id) {
            layer.confirm('确定同意吗?', {icon: 3, title: '提示'}, function (index) {
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    url: "/userdraw/approval/" + id,
                    data: {
                        'applyStatus': '2'
                    },
                    success: function (res) {
                        layer.msg(res.message, {time: 2000}, function () {
                            if (res.code === '0') {
                                location.reload();
                            }
                        });
                    }
                });
            });
        }

        function refuse(id) {
            layer.confirm('确定拒绝吗?', {icon: 3, title: '提示'}, function (index) {
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    url: "/userdraw/approval/" + id,
                    data: {
                        'applyStatus': '3'
                    },
                    success: function (res) {
                        layer.msg(res.message, {time: 2000}, function () {
                            location.reload();
                        });
                    }
                });
            });
        }
    </script>
</#assign>
<@layout title="用户余额" active="userAccount">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            用户余额
        </h1>
        <ol class="breadcrumb">
            <li><a href="/"><i class="fa fa-home"></i> 管理后台</a></li>
            <li><a href="/userAccount/index"><i class="fa fa-list-ul"></i> 平台财务管理</a></li>
            <li class="active"><i class="fa fa-table"></i> 用户余额</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <!-- Default box -->
        <div class="box box-primary">
            <div class="box-header">
                <form class="form-horizontal form-edit" method="post" action="/userAccount/userBalance" id="searchForm">
                    <div class="form-group" style="margin-top:10px;">
                        <div class="col-sm-2">
                            <input placeholder="请输入用户昵称" id="username" name="username" class="form-control" type="text"
                                   value="${searchUser.username!}">
                        </div>
                        <div class="col-sm-2">
                            <input placeholder="请输入手机号" id="phone" name="phone" class="form-control" type="text"
                                   value="${searchUser.phone!}">
                        </div>
                        <div class="btn-group">
                            <button type="submit" class="btn btn-primary" data-btn-type="search">查询</button>
                            <button type="button" class="btn btn-default" data-btn-type="reset"
                                    onclick="javascript:$('#searchForm')[0].reset()">重置
                            </button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="box-body">
                <table class="table table-striped">
                    <tr>
                        <th>用户昵称</th>
                        <th>用户手机号</th>
                        <th>余额</th>
                        <th>代收款余额</th>
                        <th>操作</th>
                    </tr>
                    <#list pageInfo.list as item>
                        <tr>
                            <td>${item.nickName!}</td>
                            <td>${item.phone!}</td>
                            <td>${item.accountBalance?string('0.00')!}</td>
                            <td>${item.collectBal?string('0.00')!}</td>
                            <td><a class="btn btn-sm btn-success" href="/userAccount/index/${item.id}" data-btn-type="detail">查看余额明细</a></td>
                        </tr>
                    </#list>
                </table>
            </div>
            <!-- /.box-body -->
            <div class="box-footer clearfix">
                <@macro.page pageInfo=pageInfo url="/userAccount/userBalance?" />
            </div>
        </div>
        <!-- /.box -->

    </section>
    <!-- /.content -->
</@layout>
